import Vue from 'vue'
import Router from 'vue-router'

// 路由配置
// import Msite from '../pages/Msite/Msite'
// import Order from '../pages/Order/Order'
// import Search from '../pages/Search/Search'
// import Profile from '../pages/Profile/Profile'
import Login from '../pages/Login/Login'
import Shop from '../pages/Shop/Shop'

import ShopGoods from '../pages/Shop/ShopGoods/ShopGoods'
import ShopRatings from '../pages/Shop/ShopRatings/ShopRatings'
import ShopInfo from '../pages/Shop/ShopInfo/ShopInfo'



Vue.use(Router)

export default new Router({
  mode:"history",
  routes: [
      {
        path:'/',
        redirect:'/msite'
      },
      {
        path:'/order',
        component:()=>import('../pages/Order/Order')
      },
      ,
      {
        path:'/msite',
        component:()=>import('../pages/Msite/Msite')
      }
      ,{
        path:'/search',
        component:()=>import('../pages/Search/Search')
      },{
        path:'/profile',
        component:()=>import('../pages/Profile/Profile')
      },
      {
        path:'/login',
        component:Login,
        meta: { requiresAuth: true }
      },
      {
        path:'/shop',
        component:Shop,
        children:[
            {
              path:'goods',
              component:ShopGoods,
              meta: { requiresAuth: true }
            },
            {
              path:'ratings',
              component:ShopRatings,
              meta: { requiresAuth: true }
            },
            {
              path:'info',
              component:ShopInfo,
              meta: { requiresAuth: true }
            },
            {
            path:'',
            redirect:'goods'
            }
        ],
        meta: { requiresAuth: true }
        
        
      }
  ]
})
